home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / PRINT.H < prev    next >
C/C++ Source or Header  |  1993-11-23  |  10KB  |  303 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * print.h -     Printing helper functions, types, and definitions             *
  4. *                                                                             *
  5. *               Copyright (c) 1985-1992. Microsoft Corp.  All rights reserved.*
  6. *                                                                             *
  7. *******************************************************************************
  8. *
  9. *  PRINTDRIVER       - For inclusion with a printer driver
  10. *  NOPQ              - Prevent inclusion of priority queue APIs
  11. *
  12. \*****************************************************************************/
  13.  
  14. #ifndef _INC_PRINT
  15. #define _INC_PRINT
  16.  
  17. #ifndef RC_INVOKED
  18. #pragma pack(1)         /* Assume byte packing throughout */
  19. #endif /* !RC_INVOKED */
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {            /* Assume C declarations for C++ */
  23. #endif    /* __cplusplus */
  24.  
  25. #ifdef PRINTDRIVER
  26.  
  27. #define NORASTEROPS
  28. #define NOTEXTMETRICS
  29. #define NOGDICAPMASKS
  30. #define NOGDIOBJ
  31. #define NOBITMAP
  32. #define NOSOUND
  33. #define NOTEXTMETRIC
  34. #define NOCOMM
  35. #define NOKANJI
  36.  
  37. #include <windows.h>
  38.  
  39. #undef NORASTEROPS
  40. #undef NOTEXTMETRICS
  41. #undef NOGDICAPMASKS
  42. #undef NOGDICAPMASKS
  43. #undef NOGDIOBJ
  44. #undef NOBITMAP
  45. #undef NOSOUND
  46. #undef NOTEXTMETRIC
  47. #undef NOCOMM
  48. #undef NOKANJI
  49.  
  50. #define NOPTRC    /* don't allow gdidefs.inc to redef these */
  51. #define PTTYPE POINT
  52.  
  53. #define PQERROR (-1)
  54.  
  55. #ifndef NOPQ
  56.  
  57. DECLARE_HANDLE(HPQ);
  58.  
  59. HPQ     WINAPI CreatePQ(int);
  60. int     WINAPI MinPQ(HPQ);
  61. int     WINAPI ExtractPQ(HPQ);
  62. int     WINAPI InsertPQ(HPQ, int, int);
  63. int     WINAPI SizePQ(HPQ, int);
  64. void    WINAPI DeletePQ(HPQ);
  65. #endif  /* !NOPQ */
  66.  
  67. /* Spool routines for use by printer drivers */
  68.  
  69. DECLARE_HANDLE(HPJOB);
  70.  
  71. HPJOB   WINAPI OpenJob(LPSTR, LPSTR, HPJOB);
  72. int     WINAPI StartSpoolPage(HPJOB);
  73. int     WINAPI EndSpoolPage(HPJOB);
  74. int     WINAPI WriteSpool(HPJOB, LPSTR, int);
  75. int     WINAPI CloseJob(HPJOB);
  76. int     WINAPI DeleteJob(HPJOB, int);
  77. int     WINAPI WriteDialog(HPJOB, LPSTR, int);
  78. int     WINAPI DeleteSpoolPage(HPJOB);
  79.  
  80. #endif /* !PRINTDRIVER */
  81.  
  82. typedef struct tagBANDINFOSTRUCT
  83. {
  84.     BOOL    fGraphics;
  85.     BOOL    fText;
  86.     RECT    rcGraphics;
  87. } BANDINFOSTRUCT, FAR* LPBI;
  88.  
  89. #define USA_COUNTRYCODE 1
  90.  
  91. /*
  92.  *  Printer driver initialization using ExtDeviceMode()
  93.  *  and DeviceCapabilities().
  94.  *  This replaces Drivinit.h
  95.  */
  96.  
  97. /* size of a device name string */
  98. #define CCHDEVICENAME 32
  99. #define CCHPAPERNAME  64
  100.  
  101. /* current version of specification */
  102. #define DM_SPECVERSION 0x30A
  103.  
  104. /* field selection bits */
  105. #define DM_ORIENTATION        0x0000001L
  106. #define DM_PAPERSIZE        0x0000002L
  107. #define DM_PAPERLENGTH        0x0000004L
  108. #define DM_PAPERWIDTH        0x0000008L
  109. #define DM_SCALE        0x0000010L
  110. #define DM_COPIES        0x0000100L
  111. #define DM_DEFAULTSOURCE    0x0000200L
  112. #define DM_PRINTQUALITY     0x0000400L
  113. #define DM_COLOR        0x0000800L
  114. #define DM_DUPLEX        0x0001000L
  115. #define DM_YRESOLUTION        0x0002000L
  116. #define DM_TTOPTION        0x0004000L
  117.  
  118. /* orientation selections */
  119. #define DMORIENT_PORTRAIT   1
  120. #define DMORIENT_LANDSCAPE  2
  121.  
  122. /* paper selections */
  123. /*  Warning: The PostScript driver mistakingly uses DMPAPER_ values between
  124.  *  50 and 56.  Don't use this range when defining new paper sizes.
  125.  */
  126. #define DMPAPER_FIRST        DMPAPER_LETTER
  127. #define DMPAPER_LETTER      1           /* Letter 8 1/2 x 11 in               */
  128. #define DMPAPER_LETTERSMALL 2           /* Letter Small 8 1/2 x 11 in         */
  129. #define DMPAPER_TABLOID     3           /* Tabloid 11 x 17 in                 */
  130. #define DMPAPER_LEDGER      4           /* Ledger 17 x 11 in                  */
  131. #define DMPAPER_LEGAL       5           /* Legal 8 1/2 x 14 in                */
  132. #define DMPAPER_STATEMENT   6           /* Statement 5 1/2 x 8 1/2 in         */
  133. #define DMPAPER_EXECUTIVE   7        /* Executive 7 1/4 x 10 1/2 in          */
  134. #define DMPAPER_A3          8           /* A3 297 x 420 mm                    */
  135. #define DMPAPER_A4          9           /* A4 210 x 297 mm                    */
  136. #define DMPAPER_A4SMALL     10          /* A4 Small 210 x 297 mm              */
  137. #define DMPAPER_A5          11          /* A5 148 x 210 mm                    */
  138. #define DMPAPER_B4          12          /* B4 250 x 354                       */
  139. #define DMPAPER_B5          13          /* B5 182 x 257 mm                    */
  140. #define DMPAPER_FOLIO       14          /* Folio 8 1/2 x 13 in                */
  141. #define DMPAPER_QUARTO      15          /* Quarto 215 x 275 mm                */
  142. #define DMPAPER_10X14       16          /* 10x14 in                           */
  143. #define DMPAPER_11X17       17          /* 11x17 in                           */
  144. #define DMPAPER_NOTE        18          /* Note 8 1/2 x 11 in                 */
  145. #define DMPAPER_ENV_9       19          /* Envelope #9 3 7/8 x 8 7/8          */
  146. #define DMPAPER_ENV_10      20          /* Envelope #10 4 1/8 x 9 1/2         */
  147. #define DMPAPER_ENV_11      21          /* Envelope #11 4 1/2 x 10 3/8        */
  148. #define DMPAPER_ENV_12      22          /* Envelope #12 4 \276 x 11           */
  149. #define DMPAPER_ENV_14      23          /* Envelope #14 5 x 11 1/2            */
  150. #define DMPAPER_CSHEET      24          /* C size sheet                       */
  151. #define DMPAPER_DSHEET      25          /* D size sheet                       */
  152. #define DMPAPER_ESHEET      26          /* E size sheet                       */
  153. #define DMPAPER_ENV_DL      27          /* Envelope DL 110 x 220mm            */
  154. #define DMPAPER_ENV_C5      28          /* Envelope C5 162 x 229 mm           */
  155. #define DMPAPER_ENV_C3      29          /* Envelope C3  324 x 458 mm          */
  156. #define DMPAPER_ENV_C4      30          /* Envelope C4  229 x 324 mm          */
  157. #define DMPAPER_ENV_C6      31          /* Envelope C6  114 x 162 mm          */
  158. #define DMPAPER_ENV_C65     32          /* Envelope C65 114 x 229 mm          */
  159. #define DMPAPER_ENV_B4      33          /* Envelope B4  250 x 353 mm          */
  160. #define DMPAPER_ENV_B5      34          /* Envelope B5  176 x 250 mm          */
  161. #define DMPAPER_ENV_B6      35          /* Envelope B6  176 x 125 mm          */
  162. #define DMPAPER_ENV_ITALY   36          /* Envelope 110 x 230 mm              */
  163. #define DMPAPER_ENV_MONARCH 37          /* Envelope Monarch 3.875 x 7.5 in    */
  164. #define DMPAPER_ENV_PERSONAL 38         /* 6 3/4 Envelope 3 5/8 x 6 1/2 in    */
  165. #define DMPAPER_FANFOLD_US  39          /* US Std Fanfold 14 7/8 x 11 in      */
  166. #define DMPAPER_FANFOLD_STD_GERMAN  40  /* German Std Fanfold 8 1/2 x 12 in   */
  167. #define DMPAPER_FANFOLD_LGL_GERMAN  41  /* German Legal Fanfold 8 1/2 x 13 in */
  168.  
  169. #define DMPAPER_LAST        DMPAPER_FANFOLD_LGL_GERMAN
  170.  
  171. #define DMPAPER_USER        256
  172.  
  173. /* bin selections */
  174. #define DMBIN_FIRST        DMBIN_UPPER
  175. #define DMBIN_UPPER        1
  176. #define DMBIN_ONLYONE        1
  177. #define DMBIN_LOWER        2
  178. #define DMBIN_MIDDLE        3
  179. #define DMBIN_MANUAL        4
  180. #define DMBIN_ENVELOPE        5
  181. #define DMBIN_ENVMANUAL     6
  182. #define DMBIN_AUTO        7
  183. #define DMBIN_TRACTOR        8
  184. #define DMBIN_SMALLFMT        9
  185. #define DMBIN_LARGEFMT        10
  186. #define DMBIN_LARGECAPACITY 11
  187. #define DMBIN_CASSETTE      14
  188. #define DMBIN_LAST        DMBIN_CASSETTE
  189.  
  190. #define DMBIN_USER        256     /* device specific bins start here */
  191.  
  192. /* print qualities */
  193. #define DMRES_DRAFT        (-1)
  194. #define DMRES_LOW        (-2)
  195. #define DMRES_MEDIUM        (-3)
  196. #define DMRES_HIGH        (-4)
  197.  
  198. /* color enable/disable for color printers */
  199. #define DMCOLOR_MONOCHROME  1
  200. #define DMCOLOR_COLOR        2
  201.  
  202. /* duplex enable */
  203. #define DMDUP_SIMPLEX     1
  204. #define DMDUP_VERTICAL     2
  205. #define DMDUP_HORIZONTAL 3
  206.  
  207. /* TrueType options */
  208. #define DMTT_BITMAP     1       /* print TT fonts as graphics */
  209. #define DMTT_DOWNLOAD   2       /* download TT fonts as soft fonts */
  210. #define DMTT_SUBDEV     3       /* substitute device fonts for TT fonts */
  211.  
  212. typedef struct tagDEVMODE
  213. {
  214.     char  dmDeviceName[CCHDEVICENAME];
  215.     UINT  dmSpecVersion;
  216.     UINT  dmDriverVersion;
  217.     UINT  dmSize;
  218.     UINT  dmDriverExtra;
  219.     DWORD dmFields;
  220.     int   dmOrientation;
  221.     int   dmPaperSize;
  222.     int   dmPaperLength;
  223.     int   dmPaperWidth;
  224.     int   dmScale;
  225.     int   dmCopies;
  226.     int   dmDefaultSource;
  227.     int   dmPrintQuality;
  228.     int   dmColor;
  229.     int   dmDuplex;
  230.     int   dmYResolution;
  231.     int   dmTTOption;
  232. } DEVMODE;
  233.  
  234. typedef DEVMODE* PDEVMODE, NEAR* NPDEVMODE, FAR* LPDEVMODE;
  235.  
  236. /* mode selections for the device mode function */
  237. #define DM_UPDATE        1
  238. #define DM_COPY         2
  239. #define DM_PROMPT        4
  240. #define DM_MODIFY        8
  241.  
  242. #define DM_IN_BUFFER        DM_MODIFY
  243. #define DM_IN_PROMPT        DM_PROMPT
  244. #define DM_OUT_BUFFER        DM_COPY
  245. #define DM_OUT_DEFAULT        DM_UPDATE
  246.  
  247. /* device capabilities indices */
  248. #define DC_FIELDS        1
  249. #define DC_PAPERS        2
  250. #define DC_PAPERSIZE        3
  251. #define DC_MINEXTENT        4
  252. #define DC_MAXEXTENT        5
  253. #define DC_BINS         6
  254. #define DC_DUPLEX        7
  255. #define DC_SIZE         8
  256. #define DC_EXTRA        9
  257. #define DC_VERSION        10
  258. #define DC_DRIVER        11
  259. #define DC_BINNAMES        12
  260. #define DC_ENUMRESOLUTIONS  13
  261. #define DC_FILEDEPENDENCIES 14
  262. #define DC_TRUETYPE        15
  263. #define DC_PAPERNAMES        16
  264. #define DC_ORIENTATION        17
  265. #define DC_COPIES        18
  266.  
  267. /* bit fields of the return value (DWORD) for DC_TRUETYPE */
  268. #define DCTT_BITMAP        0x0000001L
  269. #define DCTT_DOWNLOAD        0x0000002L
  270. #define DCTT_SUBDEV        0x0000004L
  271.  
  272. /* export ordinal definitions */
  273. #define PROC_EXTDEVICEMODE    MAKEINTRESOURCE(90)
  274. #define PROC_DEVICECAPABILITIES MAKEINTRESOURCE(91)
  275. #define PROC_OLDDEVICEMODE    MAKEINTRESOURCE(13)
  276.  
  277. /* define types of pointers to ExtDeviceMode() and DeviceCapabilities()
  278.  * functions
  279.  */
  280. typedef UINT   (CALLBACK* LPFNDEVMODE)(HWND, HMODULE, DEVMODE FAR*,
  281.                           LPSTR, LPSTR, DEVMODE FAR*, LPSTR, UINT);
  282.  
  283. typedef DWORD  (CALLBACK* LPFNDEVCAPS)(LPSTR, LPSTR, UINT, LPSTR, DEVMODE FAR*);
  284.  
  285. HDC     WINAPI ResetDC(HDC, const DEVMODE FAR*);
  286.  
  287. /* this structure is used by the GETSETSCREENPARAMS escape */
  288. typedef struct tagSCREENPARAMS
  289. {
  290.    int angle;
  291.    int frequency;
  292. } SCREENPARAMS;
  293.  
  294. #ifdef __cplusplus
  295. }
  296. #endif    /* __cplusplus */
  297.  
  298. #ifndef RC_INVOKED
  299. #pragma pack()
  300. #endif  /* !RC_INVOKED */
  301.  
  302. #endif  /* !_INC_PRINT */
  303.